﻿using System;
using System.IO;
using System.Text;
using System.Collections.Generic;

using DreamCube.Foundation.Basic.Utility;

namespace DreamCube.Websites.UI
{
    public partial class SystemList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            CreateSystemList();
        }

        /// <summary>
        /// 创建系统列表
        /// </summary>
        protected void CreateSystemList()
        {
            String path = MyWebsite.MapPath(@"~\Common\Configs\Systems.xml");
            List<BLL.WebSystem> systemList = BLL.WebSystem.GetAllSystems(path);
            StringBuilder builder = new StringBuilder();
            String template = "<br>{0}、&nbsp;<a href='{1}'>{2}</a>({3})<br>";
            String url = MyWebsite.GetServerAddr() + "Index.aspx?systemID=";
            for (Int32 i = 0; i < systemList.Count; i++)
                builder.AppendFormat(template, i + 1, url + systemList[i].ID, systemList[i].Name, systemList[i].ID);
            lt_SystemList.Text = builder.ToString();
        }
    }
}